﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EmployeeForm.ascx.cs"
    Inherits="SalesManagement.Controls.List.EmployeeForm" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<ext:Store ID="storeRole" runat="server">
    <Reader>
        <ext:JsonReader IDProperty="RoleId">
            <Fields>
                <ext:RecordField Name="RoleId" />
                <ext:RecordField Name="RoleName" />
            </Fields>
        </ext:JsonReader>
    </Reader>
</ext:Store>
<ext:Store ID="storeDepartment" runat="server">
    <Reader>
        <ext:JsonReader IDProperty="DepartmentId">
            <Fields>
                <ext:RecordField Name="DepartmentId" />
                <ext:RecordField Name="DepartmentName" />
            </Fields>
        </ext:JsonReader>
    </Reader>
</ext:Store>
<ext:Store ID="storeBranch" runat="server">
    <Reader>
        <ext:JsonReader IDProperty="BranchId">
            <Fields>
                <ext:RecordField Name="BranchId" />
                <ext:RecordField Name="BranchName" />
            </Fields>
        </ext:JsonReader>
    </Reader>
</ext:Store>
<ext:Store ID="storePosition" runat="server">
    <Reader>
        <ext:JsonReader IDProperty="PositionId">
            <Fields>
                <ext:RecordField Name="PositionId" />
                <ext:RecordField Name="PositionName" />
            </Fields>
        </ext:JsonReader>
    </Reader>
</ext:Store>
<ext:Window ID="winDetails" runat="server" Title="Chi tiết Nhân viên" Frame="false"
    Hidden="true" CenterOnLoad="true" Width="653" Height="104" Resizable="false"
    Closable="true" Layout="Fit" AutoHeight="true" Icon="Group" Padding="2">
    <Items>
        <ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0" Frame="true" DeferredRender="false"
            AutoHeight="true" BodyStyle="background-color:transparent;" Border="true" MonitorValid="true">
            <Items>
                <ext:FormPanel ID="pnlEmpInfo" Title="Thông tin Nhân viên" runat="server" BodyStyle="background-color:transparent;"
                    AutoWidth="true" Height="165" Layout="ColumnLayout" Border="false" Padding="5"
                    MonitorValid="true">
                    <Items>
                        <ext:Hidden ID="hdfEmployeeId" runat="server" />
                        <ext:Panel ID="pnlEmpInfo1" runat="server" Border="false" Header="false" ColumnWidth=".59"
                            Layout="Form" LabelAlign="Left" BodyStyle="background-color:transparent;" LabelWidth="80">
                            <Defaults>
                                <ext:Parameter Name="MsgTarget" Value="side" />
                                <ext:Parameter Name="BlankText" Value="Không để trống" />
                            </Defaults>
                            <Items>
                                <ext:TextField ID="txtEmployeeCode" FieldLabel="Mã nhân viên" runat="server" AnchorHorizontal="93%"
                                    AllowBlank="false" />
                                <ext:TextField ID="txtEmployeeName" FieldLabel="Tên nhân viên" runat="server" AnchorHorizontal="93%"
                                    AllowBlank="false" />
                                <ext:TextField ID="txtAddress" FieldLabel="Địa chỉ" runat="server" AnchorHorizontal="93%"
                                    AllowBlank="false" />
                                <ext:CompositeField ID="CompositeField1" runat="server" FieldLabel="Điện thoại" AnchorHorizontal="93%">
                                    <Items>
                                        <ext:TextField ID="txtPhone" runat="server" Width="100" />
                                        <ext:DisplayField ID="DisplayField1" runat="server" Text="Di động:" />
                                        <ext:TextField ID="txtMobile" runat="server" Width="100" />
                                    </Items>
                                </ext:CompositeField>
                                <ext:TextField ID="txtEmail" FieldLabel="Email" runat="server" AnchorHorizontal="93%" />
                                <ext:CompositeField ID="CompositeField2" runat="server" FieldLabel="Fax" AnchorHorizontal="93%">
                                    <Items>
                                        <ext:TextField ID="txtFax" runat="server" Width="100" />
                                        <ext:DisplayField ID="DisplayField2" runat="server" Text="Website:" />
                                        <ext:TextField ID="txtWebsite" runat="server" Width="100" />
                                    </Items>
                                </ext:CompositeField>
                            </Items>
                        </ext:Panel>
                        <ext:Panel ID="pnlEmpInfo2" runat="server" Border="false" Layout="Form" ColumnWidth=".5"
                            LabelAlign="Left" BodyStyle="background-color:transparent;" LabelWidth="60">
                            <Defaults>
                                <ext:Parameter Name="MsgTarget" Value="side" />
                                <ext:Parameter Name="BlankText" Value="Không để trống" />
                            </Defaults>
                            <Items>
                                <ext:TextField ID="txtTaxCode" runat="server" FieldLabel="Mã thuế" AnchorHorizontal="93%" />
                                <ext:ComboBox ID="cbbBranch" runat="server" FieldLabel="Chi nhánh" AnchorHorizontal="93%"
                                    StoreID="storeBranch" DisplayField="BranchName" ValueField="BranchId" EmptyText="Chọn Chi nhánh" />
                                <ext:ComboBox ID="cbbDepartment" runat="server" FieldLabel="Bộ phận" AnchorHorizontal="93%"
                                    StoreID="storeDepartment" DisplayField="DepartmentName" ValueField="DepartmentId"
                                    AllowBlank="false" BlankText="Không để trống" EmptyText="Chọn Bộ phận" />
                                <ext:ComboBox ID="cbbPosition" runat="server" FieldLabel="Chức vụ" AnchorHorizontal="93%"
                                    StoreID="storePosition" DisplayField="PositionName" ValueField="PositionId" AllowBlank="false"
                                    BlankText="Không để trống" EmptyText="Chọn Chức vụ" />
                                <ext:CheckboxGroup ID="CheckboxGroup1" runat="server" FieldLabel="Kích hoạt">
                                    <Items>
                                        <ext:Checkbox ID="ckbIsActive" runat="server" Checked="true" />
                                    </Items>
                                </ext:CheckboxGroup>
                            </Items>
                        </ext:Panel>
                    </Items>
                    <Listeners>
                        <ClientValidation Handler="#{btnSave}.setDisabled(!valid);" />
                    </Listeners>
                </ext:FormPanel>
                <ext:FormPanel ID="pnlLoginInfo" Title="Thông tin Đăng nhập" runat="server" BodyStyle="background-color:transparent;"
                    AutoWidth="true" Height="165" Layout="RowLayout" Border="false" Padding="5">
                    <Items>
                        <ext:Hidden ID="hdfUserName" runat="server" />
                        <ext:TextField ID="txtUserName" runat="server" FieldLabel="Tên đăng nhập" AnchorHorizontal="100%">
                        </ext:TextField>
                        <ext:TextField ID="txtPassword" runat="server" FieldLabel="Mật khẩu" InputType="Password"
                            AnchorHorizontal="100%" />
                        <ext:TextField ID="txtConfirmPassword" runat="server" FieldLabel="Nhắc lại" InputType="Password"
                            AnchorHorizontal="100%" Vtype="password" VtypeText="Mật khẩu không giống nhau">
                            <CustomConfig>
                                <ext:ConfigItem Name="initialPassField" Value="#{txtPassword}" Mode="Value" />
                            </CustomConfig>
                        </ext:TextField>
                        <ext:ComboBox ID="cbbRole" runat="server" FieldLabel="Quyền hạn" AnchorHorizontal="100%"
                            StoreID="storeRole" DisplayField="RoleName" ValueField="RoleId" EmptyText="Chọn Quyền hạn" />
                        <ext:CheckboxGroup ID="CheckboxGroup2" runat="server" FieldLabel="Kích hoạt">
                            <Items>
                                <ext:Checkbox ID="Checkbox1" runat="server" Checked="true" />
                            </Items>
                        </ext:CheckboxGroup>
                    </Items>
                </ext:FormPanel>
            </Items>
        </ext:TabPanel>
    </Items>
    <Buttons>
        <ext:Button ID="btnSave" runat="server" Text="Lưu" Icon="Disk">
            <DirectEvents>
                <Click OnEvent="btnSave_Click" />
            </DirectEvents>
        </ext:Button>
        <ext:Button ID="btnCancel" runat="server" Text="Hủy bỏ" Icon="Cancel">
            <Listeners>
                <Click Handler="#{winDetails}.hide();" />
            </Listeners>
        </ext:Button>
    </Buttons>
</ext:Window>
